home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / tcoop10a.zip / DEMO.ZIP / TESTICON.CPP < prev    next >
C/C++ Source or Header  |  1991-11-20  |  817b  |  50 lines

  1. //
  2. //      TESTICON.CPP
  3. //      version 1.00    11/15/91
  4. //      uses Icon Class in ICON.CPP
  5. //      copyright (c) 1991 by James S. Clark
  6. //      all rights reserved
  7. //
  8.  
  9. #include <graphics.h>
  10.  
  11. #include <stdlib.h>        // random
  12. #include <conio.h>        // getch()
  13.  
  14. #include "icon.hpp"
  15.  
  16.  
  17. //    setup graphics mode
  18.  
  19. void     initgraphics(void)
  20. {
  21.     int    graphdriver = EGA;
  22.     int    graphmode = EGALO;
  23.  
  24.     initgraph(&graphdriver, &graphmode, "C:\\");
  25.     if (graphresult()) exit(1);
  26. }
  27.  
  28.  
  29. main(void)
  30. {
  31.     Icon    *icon;
  32.     int    i;
  33.  
  34.     initgraphics();
  35.  
  36.     icon = new Icon(64, 32, 16);        // create icon handler
  37.     icon->read(32, "MAP.IMG");        // read 128 icons from MAP
  38.  
  39.     for (i=0; i<16; i++)            // draw the first 16
  40.         icon->put(i, i, 1);
  41.  
  42.     getch();
  43.  
  44.     delete icon;                // deallocate memory
  45.     closegraph();
  46.     return 0;
  47. }
  48.  
  49.  
  50.